﻿using BYSJ.BLL;
using BYSJ.IBLL;
using BYSJ.Web.Commmend;
using BYSJ.Web.Filters;
using BYSJ.Web.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BYSJ.Web.Controllers
{
    public class searchController : Controller
    {
        //
        // GET: /search/
        [AdminFilter]
        [ShenFen]
        public ActionResult Index()
        {
            IFileMangSetService fileserver = new FileMangSetService();
            string query=Request["query"].ToString();
            FileSearchlist fileserachlist = new FileSearchlist();
            if(query!="")
            {
                var file = fileserver.LoadEntities(u => u.FileName.Contains(query) && u.FileIsdel == false).ToList();
                
                fileserachlist.file = new ConvertmModel().FileSearch(file);
            } 
            return View(fileserachlist);
        }

    }
}
